package com.itheima.entity;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class Employee {

    private Integer empId;
    private String name;
    private String sex;
    private Integer age;
    private String phone;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date joinDate;
    private String address;
    private Integer deptId;
    private String remark;

    public Employee() {
    }

    public Employee(String name, String sex, Integer age, String phone, Date joinDate, String address, Integer deptId, String remark) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.phone = phone;
        this.joinDate = joinDate;
        this.address = address;
        this.deptId = deptId;
        this.remark = remark;
    }

    //一对多关系映射
    private Department department;

    public Employee(Integer empId, String name, String sex, Integer age, String phone, Date joinDate, String address, Integer deptId, String remark) {
        this.empId = empId;
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.phone = phone;
        this.joinDate = joinDate;
        this.address = address;
        this.deptId = deptId;
        this.remark = remark;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public Integer getEmpId() {
        return empId;
    }

    public void setEmpId(Integer empId) {
        this.empId = empId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Date getJoinDate() {
        return joinDate;
    }

    public void setJoinDate(Date joinDate) {
        this.joinDate = joinDate;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "empId=" + empId +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                ", phone='" + phone + '\'' +
                ", joinDate=" + joinDate +
                ", address='" + address + '\'' +
                ", deptId=" + deptId +
                ", remark='" + remark + '\'' +
                '}';
    }
}
